/**
 * Redux store configuration
 */

import { configureStore } from '@reduxjs/toolkit';
import { RootState } from '@/types';

// Import reducers (will be added as we create slices)
import projectReducer from './slices/projectSlice';

export const store = configureStore({
  reducer: {
    project: projectReducer,
  },
  middleware: (getDefaultMiddleware) =>
    getDefaultMiddleware({
      serializableCheck: {
        // Ignore non-serializable date objects
        ignoredActions: ['project/setConfig', 'history/setSelectedItem'],
        ignoredPaths: [
          'files.packageJsonFile',
          'files.routerConfigFile',
          'menu.menuData.createdAt',
          'menu.menuData.updatedAt',
        ],
      },
    }),
});

export type AppDispatch = typeof store.dispatch;